package android.cmpe451.group7.util;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * A place to put utility functions
 */
public class Utils {

	public static boolean IsValidEmail(String email) {
		boolean result = false;
		String PATERN = "^[_A-Za-z0-9-\\+]+(\\.[_A-Za-z0-9-]+)*@"
				+ "[A-Za-z0-9-]+(\\.[A-Za-z0-9]+)*(\\.[A-Za-z]{2,})$";

		Pattern pattern = Pattern.compile(PATERN);
		Matcher matcher = pattern.matcher(email);

		result = matcher.matches();
		return result;
	}

	public static boolean IsValidPassword(String password) {
		boolean result = true;

		if (password.length() < 6) {
			result = false;
		}

		return result;
	}

	public static boolean IsEmpty(String entry) {
		boolean result = true;
		if (entry.length() < 2) {
			result = false;
		}
		return result;
	}

}
